VPATH=/home/ftp/embeded-linux-c/embeded/srcb
OBJ=a.o b.o

.PHONY:all

all:test $(OBJ)

ret=$(subst ok,ng,the result is ok)
result:=$(subst  china,the world good,I love china)
patresult:=$(patsubst %.c,%.o,x.c y.c)
wildcardtest:=$(wildcard *.c)
stripret:=$(strip      CHINA                 ) 
findstringret:=$(findstring china,i love china)
filt:=fa.c fb.c fc.c fd.c fe.d
filterret:=$(filter %.c %.d,$(filt))
addsuffixret:=$(addsuffix .c,x y z e r t y u i e)
preret:=p1 p2 p3 p4 p5 p6 p7
addprefixret:=$(addprefix src/home/dd/test/p/,$(preret))
foreacht:= a b c d e f 
foreachresult:=$(foreach b,$(foreacht),$(b).hpp)
foreachresultc:=$(foreach c,$(foreacht),$(c).cpp)
callret=$(2)$(1)
callresult:=$(call callret,x,y) 

ifret:=$(if china,Right)

ifret1:=
ifresult=:$(if $(ifret1),CHINA,OK)
redir:=$(dir /home/test/a/ac/c/test.c)

#wariingret:=$(warning warning occured!)
#errorret:=$(error error information tips!)
test:$(OBJ)
	@echo [4]this is all test.......................
	gcc a.o srcb/b.o -o test 
a.o:a.c
	@echo this is a test for warning : $(wariingret)
	@echo this is a test for dir : $(redir)
	@echo this is a test for error:$(errorret)
	@echo this is a test fot two para if: $(ifresult)
	@echo this is a test fot if : $(ifret)
	@echo this a test for call : $(callresult)
	@echo this a test for foreachaddcpppsuffix:$(foreachresultc)
	@echo this a test for  foreach : $(foreachresult)
	@echo this a test for addprefix : $(addprefixret)
	@echo this a test for addsuffix:$(addsuffixret)
	@echo this a test for filter:$(filterret)
	@echo this a test for findstringstr:$(findstringret)
	@echo this a test for strip:$(stripret)
	@echo this is a test for wildcardtest:$(wildcardtest)
	@echo  this is a test fot patsubst:$(patresult)
	@echo this a test for sunst:$(ret)
	@echo $(result)
	@echo [0]this is first a.c.........
	gcc -c a.c -o a.o 
b.o:b.c	
	@echo [1]this is second  one...
	cd srcb && make
	@echo [3]this is second end one...
.PHONY:clean

clean:
	rm -rf test $(OBJ) srcb/b.o
